import {
    DIC
} from '@/const/dic';
import {
    parseTimeFormatter,
    moneyFormatter
} from '../formatter';
import Store from '../../store/';
const userRoleId = Store.state.user.userInfo.roleId;
const isCaptain = userRoleId === 1;
export const taskOrderTableOption = {
    border: true,
    index: true,
    selection: true,
    tip: false,
    calcHeight: 460,
    columnBtn: false,
    height: "auto",
    searchClearable: false,
    selectClearBtn: false,
    clearable: false,
    searchResetBtn: false,
    menu: true,
    menuAlign: "center",
    searchBtn: true,
    labelWidth: 120,
    refreshBtn: true,
    addBtn: false,
    dialogWidth: '800px',
    dateBtn: true,
    dateDefault: false,
    dialogHeight: 'auto',
    menuWidth: 180,
    editBtn: false,
    viewBtn: false,
    delBtn: false,
    column: [{
            "label": "下单时间",
            "prop": "CreateTime",
            "search": false,
            "width": 160,
            "row": false,
            "readonly": false,
            "span": 12,
            formatter: parseTimeFormatter("CreateTime"),
            "display": false
        },
        {
            "label": "店铺名称",
            "prop": "ShopName",
            "search": true,
            "type": "text",
            "width": 140,
            "row": false,
            "readonly": false,
            "span": 12,
            "display": true,
            "rules": [{
                "required": true,
                "message": "请选择任务",
                "trigger": "blur"
            }]
        },
        {
            "label": "商品名称",
            "prop": "GoodsName",
            "search": true,
            "type": "text",
            "width": "auto",
            "row": false,
            "minWidth": "250",
            "readonly": false,
            "span": 12,
            "display": true,
            "rules": [{
                "required": true,
                "message": "请选择任务",
                "trigger": "blur"
            }]
        },
        {
            "label": "成交价",
            "prop": "Price",
            "width": 100,
            "search": false,
        },
        {
            "label": "佣金",
            "prop": "Award",
            "width": 100,
            "search": false,
        },
        {
            "label": "系统编号",
            "prop": "OrderNo",
            "search": true,
            "type": "text",
            "width": "170",
            "row": false,
            "readonly": false,
            "span": 12,
            "display": true,
            "rules": [{
                "required": true,
                "message": "请输入订单编号",
                "trigger": "blur"
            }]
        },
        {
            "label": "订单编号",
            "prop": "TaobaoOrderNo",
            "search": true,
            "type": "text",
            "width": "120",
            "row": false,
            "readonly": false,
            "span": 12,
            "display": true
        },
        {
            "label": "淘宝会员号",
            "prop": "WangNo",
            "search": false,
            width: 120
        },
        {
            "label": "地区",
            "prop": "Area",
            "width": 100,
            "search": false,
        },
        {
            "label": "状态",
            "prop": "Status",
            "search": true,
            "type": "select",
            "width": "auto",
            "row": false,
            "minWidth": "120",
            "readonly": false,
            "span": 12,
            "display": true,
            "rules": [{
                "required": true,
                "message": "请选择状态",
                "trigger": "blur"
            }],
            "placeholder": "请选择状态",
            "dicData": DIC["taskOrderStatusDic"]
        },
        {
            "label": "刷手",
            "prop": "UserNo",
            "search": false,
            "type": "select",
            "fixed": false,
            "width": "auto",
            "row": false,
            "minWidth": "120",
            "readonly": false,
            "span": 12,
            "display": true,
            "rules": [{
                "required": true,
                "message": "请选择刷手",
                "trigger": "blur"
            }]
        },
        {
            "label": "性别",
            "prop": "Sex",
            dicData: DIC.sex2,
            "width": 100,
            "search": false,
        },
        {
            "label": "团长",
            "prop": "CaptainName",
            "width": 100,
            hide: isCaptain,
            type: 'text',
            filterable: true,
            "search": !isCaptain,
        },
        {
            "label": "是否返款",
            "prop": "RefundFlag",
            "width": 100,
            type: 'select',
            display: false,
            dicData: DIC.RefundFlag,
            // filterable: true,
            "search": true,
        },
        {
            "label": "审核备注",
            "prop": "Notes",
            "search": false,
            "type": "textarea",
            "fixed": false,
            "width": "auto",
            "row": false,
            "minWidth": "120",
            "readonly": false,
            "span": 24,
            "display": true
        }
    ]
};
